package com.demo575_分糖果;
/**
 * 通过!!!!
 */

import java.util.TreeSet;

public class Solution {
    public static void main(String[] args) {

    }
    public int distributeCandies(int[] candyType) {
        TreeSet<Integer> set = new TreeSet<>();
        for (int item : candyType) {
            set.add(item);
        }
        int size = set.size();

        return Math.min(size, candyType.length / 2);

    }
}
